package com.lsh.entity;

import lombok.Data;

/**
 * {
 * "access_token":"38_xKFlS_0Ugr3WQ5R90LX2Cr3A2EMj2ck89VTcIF2TeBIqnVuOyDUp3vtjqfoQe_bTP3nqHy8SvVQYpHMSrr9xMiyTylMPUZ8LR2RpY0Ouwc7TW0Q9W6vDcHwAV-pUw2-WKRcoQMawHIbgMjJfKEMgADAUOW",
 * "expires_in":7200
 * }
 */
@Data
public class Token {
    /**
     * 接口访问凭证
     */
    private String access_token;
    /**
     * 凭证过期时间  毫秒
     */
    private long expires_in;

    /**
     *{"access_token":"ACCESS_TOKEN","expires_in":7200}
     * @param accessToken  接口访问凭证
     * @param expiresIn    有效时间         凭证有效时间，单位：秒
     */
//    public Token(String accessToken, String expiresIn){
//        this.accessToken = accessToken;
//        this.expiresTime = System.currentTimeMillis()+Integer.parseInt(expiresIn)*1000;
//    }

    /**
     * 判断accessToken是否过期
     * @return    返回true   过期
     */
//    public Boolean isExpired(){
//        return System.currentTimeMillis()>expiresTime;
//    }
}
